
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,member-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<script type="text/javascript" src="lib/PIE_IE678.js"></script>
<![endif]-->
<link href="css/H-ui.min.css" rel="stylesheet" type="text/css" />
<link href="css/H-ui.admin.css" rel="stylesheet" type="text/css" />
<link href="lib/Hui-iconfont/1.0.1/iconfont.css" rel="stylesheet"
	type="text/css" />
<!--[if IE 6]>
<script type="text/javascript" src="http://lib.h-ui.net/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>提现管理</title>
</head>
<body>
	<nav class="breadcrumb">
		<a class="btn btn-success btn-refresh radius r mr-20"
			style="line-height:1.6em;margin-top:3px"
			onclick="javascript:location.replace(location.href);"
			href="javascript:location.replace(location.href);" title="刷新"><i
			class="Hui-iconfont">&#xe68f;</i></a>
	</nav>
	<div class="pd-20">
		<%-- <div class="cl pd-5 bg-1 bk-gray">
			<span class="l"> <a class="btn btn-primary radius"
				onclick="shop_add('添加商户','<%=path%>/backstage/shop-add-pre')"
				href="javascript:;"><i class="Hui-iconfont">&#xe600;</i> 添加商户</a></span>

		</div> --%>

		<div class="mt-20">
			<table
				class="table table-border table-bordered table-hover table-bg table-sort">
				<thead>
					<tr class="text-c">
						<th>ID</th>
						<th>商户名称</th>
						<th>提现金额</th>
						<!-- <th>提现后余额</th> -->
						<th>流水号</th>
						<th>申请时间</th>
						<th>状态</th>
						<th width="120">操作</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${cash}" var="ca">
						<tr class="text-c">
							<input type="hidden" id="cId" name="cId" value='${ca.id}' />
							<td>${ca.id}</td>
							<td>${ca.c_sname}</td>
							<td>${ca.money}</td>
							<%-- <td>${ca.after_money }</td> --%>
							<td>${ca.num}</td>
							<td>${ca.time }</td>
							<td class="td-status">
								<c:choose>
									<c:when test="${0==ca.status}">
										<span class="label label-warning radius">未审核</span>
									</c:when>
									<c:when test="${1==ca.status}">
										<c:if test="${ca.is_pmoney == 0}">
											<span class="label label-primary radius">待打款</span>
										</c:if>
										<c:if test="${ca.is_pmoney == 1}">
											<span class="label label-success radius">已打款</span>
										</c:if>
									</c:when>
									<c:when test="${2==ca.status}">
										<span class="label label-danger radius">审核未通过</span>
									</c:when>
								</c:choose></td>
							<td class="td-manage">
								<%-- <a style="text-decoration:none"
								onClick="shop_edit(this,'${shop.cId}')" href="javascript:;"
								title="编辑">编辑
								&nbsp;&nbsp;  || 2==ca.status--%>
								<c:choose>
								<c:when test="${0==ca.status}">
									<a style="text-decoration:none" onClick="cash_enable(this,'${ca.id}')" href="javascript:;" title="审核">审核</a>
								</c:when>
								</c:choose>
							</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
	</div>
	<script type="text/javascript" src="lib/jquery/1.9.1/jquery.min.js"></script>
	<script type="text/javascript" src="lib/layer/1.9.3/layer.js"></script>
	<script type="text/javascript" src="lib/laypage/1.2/laypage.js"></script>
	<script type="text/javascript" src="lib/My97DatePicker/WdatePicker.js"></script>
	<script type="text/javascript"
		src="lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
	<script type="text/javascript" src="js/H-ui.js"></script>
	<script type="text/javascript" src="js/H-ui.admin.js"></script>
	<script type="text/javascript">
		$(function() {
			$('.table-sort').dataTable({
				"aaSorting" : [ [ 0, "desc" ] ],//默认第几个排序
				"bStateSave" : true,//状态保存
				"aoColumnDefs" : [
				//{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
				{
					"orderable" : false,
					"aTargets" : [ 1, 2 ]
				} // 制定列不参与排序
				]
			});
			$('.table-sort tbody').on('click', 'tr', function() {
				if ($(this).hasClass('selected')) {
					$(this).removeClass('selected');
				} else {
					table.$('tr.selected').removeClass('selected');
					$(this).addClass('selected');
				}
			});
		});
		
		/*添加*/
		function shop_add(title,url){
			var index = layer.open({
				type: 2,
				title: title,
				content: url
			});
			layer.full(index);
		}
		/*编辑*/
		function shop_edit(obj,id,w,h){
			var edit_page = "<%=path%>/backstage/shop-add-pre?id="+id;
			var index = layer.open({
				type: 2,
				title: "编辑",
				content: edit_page
			});
			layer.full(index);
		}
		/*审核*/
		function cash_enable(obj,id){
			layer.confirm('审核商户？', {
				btn: ['通过','不通过'], 
				shade: false,
				closeBtn : false
			},
			function(){
				$.ajax({
					type : "POST",
					url : "<%=path%>/backstage/cash-review",
					data : {
						id:id,
						type:1
					},
					error : function() {
						layer.msg('操作失败', {icon:5,time:1000});
					},
					success : function(msg) {
						$(obj).parents("tr").find(".td-status").html('<span class="label label-primary radius">待打款</span>');
						$(obj).remove();
						layer.msg('已审核');
					}
				});
			},
			function(){
				$.ajax({
					type : "POST",
					url : "<%=path%>/backstage/cash-review",
					data : {
						id:id,
						type:2
					},
					error : function() {
						layer.msg('操作失败', {icon:5,time:1000});
					},
					success : function(msg) {
						/* $(obj).parents("tr").find(".td-status").html('<span class="label label-danger radius">审核未通过</span>');
						$(obj).remove(); */
						layer.msg('审核未通过');
					}
				});
			});
		}

		/*图片-下架*/
		function product_stop(obj, id) {
			layer
					.confirm(
							'确认要下架吗？',
							function(index) {
								$(obj)
										.parents("tr")
										.find(".td-manage")
										.prepend(
												'<a style="text-decoration:none" onClick="product_start(this,id)" href="javascript:;" title="发布"><i class="Hui-iconfont">&#xe603;</i></a>');
								$(obj)
										.parents("tr")
										.find(".td-status")
										.html(
												'<span class="label label-defaunt radius">已下架</span>');
								$(obj).remove();
								layer.msg('已下架!', {
									icon : 5,
									time : 1000
								});
							});
		}
	</script>
</body>
</html>